// by Xeno
//#define __DEBUG__
private ["_hangar", "_poss", "_vehicle"];
#include "x_setup.sqf"

_mpos = markerPos QGVAR(sm_599);
_mpos set [2,0];
_mpos2 = markerPos QGVAR(sm_599_1);
_mpos2 set [2,0];
GVAR(x_sm_pos) = [_mpos, _mpos2];
// No TT: // index:99 steal plane prototype, Molos, second array position armor
GVAR(x_sm_type) = "normal"; // "convoy"

#ifdef __SMMISSIONS_MARKER__
if (true) exitWith {};
#endif

if (X_Client && {!GVAR(IS_HC_CLIENT)}) then {
#ifdef __TT__
	GVAR(cur_sm_txt) = (localize "STR_DOM_MISSIONSTRING_5068");
	GVAR(current_mission_resolved_text) = (localize "STR_DOM_MISSIONSTRING_750");
#else
	GVAR(cur_sm_txt) = (localize "STR_DOM_MISSIONSTRING_5068");
	GVAR(current_mission_resolved_text) = (localize "STR_DOM_MISSIONSTRING_750");
#endif
};

if (call FUNC(checkSHC)) then {
	__PossAndOther
	_vehicle = objNull;
	_vehicle = createVehicle [GVAR(sm_plane), _poss, [], 0, "NONE"];
	_vehicle setDir (markerDir QGVAR(sm_599));
	_vehicle setPos _poss;
	sleep 2.123;
	["specops", 3, "basic", 1, _poss,50,true] spawn FUNC(CreateInf);
	sleep 2.221;
	["shilka", 2, "bmp", 1, "tank", 0, _pos_other,1,50,true] spawn FUNC(CreateArmor);
	[_vehicle] spawn FUNC(sidesteal);
	_vehicle addMPEventHandler ["MPKilled", {if (isServer) then {[_this select 0, _this select 1, 1] call FUNC(sidempkilled)}}];
	_vehicle setDamage 0;
};
